
<!DOCTYPE html>
<html>
<head lang="en" th:include="include :: header">
    <meta charset="UTF-8">
    <meta name="description" content="哇咔咔旅行，换个方式去旅行。"/>
    <meta name="keywords" content="旅行,体验式,潮玩"/>
    <meta name="baidu-site-verification" content="j2BNI9jN0l" />
    <!--<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">-->
    <meta content="yes" name="apple-mobile-web-app-capable">
    <meta name="viewport" content="width=device-width,height=device-height,inital-scale=1.0,maximum-scale=1.0,user-scalable=no;">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge，chrome=1">
    <title>哇咔咔旅行</title>
    <link rel="stylesheet" type="text/css" href="/css/we.css?4"/>
</head>
<body class="white-bg">
<div class="mobile-about">
    <div class="cnt">
        <div class="cnt-left">
            <img src="https://cdn.321kaka.cn/DreamPics/20190826152910890.jpeg" width="100%" height="100%">
        </div>
        <div class="cnt-right">
            <div class="wrapper wrapper-content animated fadeInRight ibox-content">
                <form class="form-horizontal m" id="form-weshow">
                    <div class="form-group">
                        <div style="width: 50%;float: left">
                            <input class="form-control" id="phone" name="phone" placeholder="请输入手机号" style="font-size: 17px">
                        </div>
                        <div style="width: 30%;float: left;margin-left: 20px">
                            <a class="btn btn-success" onclick="getMyP()">获取我的推广数据</a>
                        </div>
                    </div>
                </form>
            </div>
            <input id="flag" hidden>
            <div style="text-align: center;margin-top: 1px;display: none" id="show">
                <div class="ibox float-e-margins" style="border:solid #cccccc 1px;width: 80%;margin-left: 10%">
                    <div class="ibox-title">
                        <span class="label label-success pull-right" onclick="getM()">提现</span>
                        <h5>预估推广佣金</h5>
                    </div>
                    <div class="ibox-content">
                        <h1 class="no-margins" id="money" style="color: red;"></h1>
                        <div class="stat-percent font-bold text-muted"><i class="fa fa-yen"></i></div>
                    </div>
                </div>
                <div class="ibox float-e-margins" style="border:solid #cccccc 1px;width: 80%;margin-left: 10%">
                    <div class="ibox-title">
                        <span class="label label-success pull-right" onclick="getP()">推广</span>
                        <h5>我的推广人数</h5>
                    </div>
                    <div class="ibox-content">
                        <h1 class="no-margins" id="people" style="color: red;"></h1>
                        <div class="stat-percent font-bold text-muted"><i class="fa fa-users"></i></div>
                    </div>
                </div>
            </div>

            <div style="text-align: center;margin-top: 1px;display: none" id="sorry">
                <h3>抱歉，查询不到您的推广记录！</h3>
                <p class="help-block">如有疑问，请在"哇咔咔旅行"小程序上联系客服咨询!</p>
            </div>

        </div>
    </div>
</div>
</body>
<div th:include="include :: footer"></div>
<script>

    $(function () {
        $("#flag").val(true)
    })

    $("#form-weshow").validate({
        rules:{
            phone:{
                required:true,
                isPhone:true,
            },
        },
    });

    function getM() {
        layer.msg("申请提现请在小程序上联系客服!")
    }
    function getP() {
        layer.msg("请在[哇咔咔旅游]公众号发送'推广'获取推广链接!")
    }
    function getMyP() {
        if ($.validate.form()) {
            var phone = $("#phone").val()
            if ($("#flag").val()){
                $.modal.loading("获取中...")
                $.get("/dream/open/route/queryAgentDealCount",
                    {
                        parentPhone:phone,
                    },
                    function(data){
                        if (data.data){
                            document.getElementById("show").style.display = 'block'
                            document.getElementById("sorry").style.display = 'none'
                            $("#people").text(data.data)
                            $("#money").text(data.data*30)
                        }else {
                            document.getElementById("show").style.display = 'none'
                            document.getElementById("sorry").style.display = 'block'
                        }
                        $.modal.closeLoading()
                    })
            }
        }
    }

</script>
</html>

